import { createBrowserRouter, Navigate } from 'react-router-dom'
import AppLayout from './layout/Layout'
import Task1 from './pages/day1/task1'
import Task2 from './pages/day1/task2'
import Task3 from './pages/day1/task3'
import Day2Task1 from './pages/day2/task2'
import NotFound from './404'
import Login from './Login'

const routes = createBrowserRouter([
    {
        path: '/',
        element: <AppLayout />,
        children: [
            {
                path: '/day1/task1',
                element: <Task1 />,
            },
            {
                path: '/day1/task2/:id',
                element: <Task2 />,
            },
            {
                path: '/day1/task3',
                element: <Task3 />,
            },
            {
                path: '/day2/task2',
                element: <Day2Task1 />,
            },
            {
                path: '/404',
                element: <NotFound />,
            }
        ],
    },
    {
        path: '/login',
        element: <Login />,
    },
    {   
        path: '*',
        element: <Navigate to="/404" replace />,
    }
])

export default routes;